#!/usr/bin/env python3

# Copyright (C) Kumo inc. and its affiliates.
# Author: Jeff.li lijippy@163.com
# All rights reserved.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https:#www.gnu.org/licenses/>.
#

# pyre-unsafe

from enum import Enum
from typing import List, Dict, Type, Optional

from pypollux.file import File
from pypollux.type import Type


class JoinType(Enum):
    INNER = 1
    LEFT = 2
    RIGHT = 3
    FULL = 4

class PlanNode:
    def name(self) -> str: ...
    def serialize(self) -> str: ...
    def to_string(self) -> str: ...

def deserialize_plan(str): ...

class PlanBuilder:
    def __init__(self) -> None: ...
    def table_scan(
        self,
        output_schema: Type,
        aliases: Dict[str, str] = {},
        subfields: Dict[str, List[int]] = {},
        row_index: str = "",
        connector_id: str = "prism",
        input_files: List[File] = [],
    ) -> PlanBuilder: ...
    def tpch_gen(
        self,
        table_name: str,
        columns: list[str] = [],
        scale_factor: int = 1,
        num_parts: int = 1,
        connector_id: str = "tpch"
    ) -> PlanBuilder: ...
    def table_write(
        self,
        output_file: Optional[File] = None,
        output_path: Optional[File] = None,
        connector_id: str = "hive",
        output_schema: Optional[Type] = None,
    ) -> PlanBuilder: ...
    def get_plan_node(self) -> PlanBuilder: ...
    def new_builder(self) -> PlanBuilder: ...
    def id(self) -> str: ...
